package org.example.secondkill.response;

/**
 * 错误信息枚举类
 */
public enum ResultCode {
    SUCCESS(0, "成功"),
    SERVER_ERROR(500100, "服务端异常"),
    BIND_ERROR(500101, "参数校验异常"),
    PASSWORD_ERROR(500200, "密码错误"),
    SESSION_ERROR(500201, "Session不存在或已经失效"),
    USER_NOT_EXIST(500202, "用户名不存在"),
    ORDER_NOT_EXIST(500403, "订单不存在"),
    KILL_NOT_START(500500, "秒杀还未开始"),
    KILL_ONGOING(500501, "秒杀正在进行中"),
    KILL_END(500504, "秒杀结束"),
    REPEAT_KILL(500505, "不能重复秒杀"),
    ORDER_IN_QUEUE(500506, "订单正在排队");

    private int code;
    private String msg;

    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
